<?php 

$cadena = "zapato";

function encode($cadena){
  $text1=""; 
  for($i=0; $i<strlen($cadena); $i=$i+1){
	$text=substr($cadena,$i,1);
	$value=ord($text)+3;
	$text1=$text1.chr($value);	
}
  return ($text1); 
} 

function decode($cadena){
  $text1=""; 
  for($i=0; $i<strlen($cadena); $i=$i+1){
	$text=substr($cadena,$i,1);
	$value=ord($text)-3;
	$text1=$text1.chr($value);
}
  return ($text1);
} 

#ENCODE
$text_cypher = encode($cadena);
#DECODE
$text_decypher = decode($text_cypher);

echo $text_cypher;
echo $text_decypher;



?>
